package m3d31;
//读取中文
//GBK 两个字节                        UTF-8 3个字节

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

//reader是字符输入流的顶层父类，抽象类
public class aReader {
    public static void main(String[] args) throws IOException {
        FileReader fr = new FileReader("day02\\src\\m3d31\\b.txt");

        //读取单个字符
        /*int len = 0;
        while((len = fr.read())!=-1){
            System.out.println((char)len);
        }*/

        char [] chars = new char[1024];
        int len = 0;
        while((len = fr.read(chars))!=-1){
            System.out.println(new String(chars,0,len));
        }
        fr.close();
    }
}
